package de.szut.entity;

import com.j256.ormlite.field.DatabaseField;

import java.io.Serializable;

/**
 * TODO
 * Created by dzebcuks on 19.08.13.
 */
public abstract class Ability implements Serializable {

    /**
     * Generated unique identifier for the object
     */
    @DatabaseField(generatedId = true)
    private Integer id;

    /**
     * ID for the base image to use.
     */
    //  ??? save Imagename and get Image from assets or write image into bytearray ???
    @DatabaseField
    private String image;

    /**
     * Number of points required to buy this ability.
     */
    @DatabaseField
    private int points;

    /**
     * Whether this ability was skilled by the user or not.
     */
    @DatabaseField
    private boolean skilled;

    /**
     * The basis modifier for this ability
     */
    @DatabaseField(foreign = true, foreignAutoRefresh = true, foreignAutoCreate = true)
    private Modifier modifier;

    @Override
    public boolean equals(Object o) {
        boolean equals = false;
        if (o instanceof Ability) {
            if (this.id == ((Ability)o).getId()) {
                equals = true;
            }
        }
        return equals;
    }

    public String getImage() {
        return image;
    }

    public Modifier getModifier() {
        return modifier;
    }

    public void setModifier(Modifier modifier) {
        this.modifier = modifier;
    }

    public void setImage(String image) {

        this.image = image;
    }

    public int getPoints() {
        return points;
    }

    public void setPoints(int points) {
        this.points = points;
    }

    public boolean isSkilled() {
        return skilled;
    }

    public void setSkilled(boolean skilled) {
        this.skilled = skilled;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }
}
